#include "pthread_locker.h"
#include "def.h"

int pthread_locker_test(void)
{
    printf("** pthread_locker test:\n");

    locker_t *locker = pthread_locker_create();
    assert(locker);

    int i;
    int num = 0;
    for(i = 0; i < 1024; ++i){
        locker_lock(locker);
        num++;
        printf("num = %d\n", num);
        locker_unlock(locker);
    }

    locker_destroy(locker);

    printf("** pthread_locker test success\n");
	return 0;
}
